﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp8
{
    //1、学生类：学号、姓名、年龄
   public class Student
    {
        public String Name { get; set; }
        public int Id { get;set; }
        public int Age { get; set; }
        public Student()
        {

        }

      public Student(String Name, int Id, int Age)
        {
            this.Name = Name;
            this.Age = Age;
            this.Id = Id;

        }


        public class NameSort : IComparer<Student>
        {
            public int Compare(Student x, Student y)
            {
                return x.Name.CompareTo(y.Name);
            }
        }

        public class AgeSort : IComparer<Student>
        {
            public int Compare(Student x, Student y)
            {
                return x.Age.CompareTo(y.Age);
            }
        }
        public class IdSort : IComparer<Student>
        {
            public int Compare(Student x, Student y)
            {
                return x.Id.CompareTo(y.Id);
            }
        }
    }
}
